/*

@author: zjc
@file: lianxi.go
@time: 2022/11/11 17:31
*/
package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main(){
	//fmt.Println(fun(10))
	gift()
}

//func fun(n int) (result int){
//	if n==1 || n==2{
//		return n
//	}
//	return fun(n-1)+fun(n-2)
//}
func gift(){
	s_person:=map[string]string{"A":"a","B":"b","C":"c","D":"d"}
	g_person:=[]string{"a","b","c","d"}
	rand.Seed(time.Now().UnixNano())
	Loop:
		for key, _:= range s_person {
			n := rand.Intn(len(g_person))
			r_person := g_person[n]
			if s_person[key] != r_person {
				s_person[key] = r_person
				g_person = append(g_person[:n], g_person[n+1:]...)
			} else {
				continue
			}
		}
		if len(g_person)==0{
			fmt.Println(s_person)
		}else {
			goto Loop
		}
}